<template>
  <div id="app">
    <router-view />
    <!-- 只在管理后台显示主题选择器 -->
    <theme-picker v-if="showThemePicker" />
  </div>
</template>

<script>
import ThemePicker from "@/components/ThemePicker"
import { getToken } from '@/utils/auth'

export default {
  name: "App",
  components: { ThemePicker },
  computed: {
    showThemePicker() {
      // 只有在管理后台且已登录时才显示主题选择器
      return getToken() && !this.$route.path.startsWith('/public')
    }
  }
}
</script>
<style scoped>
#app .theme-picker {
  display: none;
}
</style>
